<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/1/25
  Time: 14:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>登录页面</title>
</head>
<body>
<%--<%
    //判断session中是否含有person_id，有的话直接进入到显示所有的页面
    Object person_id = session.getAttribute("person_id");
    if(person_id!=null){
        request.getRequestDispatcher("person").forward(request,response);
    }

%>--%>
<%--<%
    //判断cookie中是否含有person_id，有的话直接进入到显示所有的页面
    Cookie[] cookies = request.getCookies();
    if(cookies!=null&&cookies.length>0){
        for (Cookie cookie : cookies) {
            if(cookie.getName().equals("person_id")){
                //直接进入到显示所有的页面
                request.getRequestDispatcher("person").forward(request,response);
            }
        }
    }
%>--%>
<form action="${pageContext.request.contextPath}/login" method="post" >
    <table>
        <tr>
            <td> 人员编号</td>
            <td><input type="text" name="person_id"></td>
        </tr>
        <tr>
            <td> 人员姓名</td>
            <td><input type="text" name="person_name"></td>
        </tr>

    </table>
    <input type="submit" value="登录">
    <input type="reset" value="重置">

</form>
<div>${message}</div>
</body>
</html>
